package vlc.ui;

import java.awt.Dimension;
import java.awt.GridLayout;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTree;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.TreeSelectionModel;



@SuppressWarnings("serial")
public class CenterInterface extends JPanel {
    private JTree p_PlaylistTree;
    public CenterInterface() {
	super(new GridLayout(1,0));
	DefaultMutableTreeNode top =new DefaultMutableTreeNode("PlayList");
	createNodes(top);
	p_PlaylistTree = new JTree(top);
	p_PlaylistTree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
	JScrollPane treeView = new JScrollPane(p_PlaylistTree);
	add(treeView);
	setVisible(false);
	p_PlaylistTree.setMinimumSize(new Dimension(0,0));
	treeView.setMinimumSize(new Dimension(0,0));
	setMinimumSize(new Dimension(0,0));
    }
	
    private class PlayList {
	public String trackName;
	public PlayList(String name) {
	    trackName = name;
	}
	    
	public String toString() {
	    return trackName;
	}
    }
	
    private void createNodes(DefaultMutableTreeNode top) {
        DefaultMutableTreeNode Folder = null;
        DefaultMutableTreeNode music = null;

        Folder = new DefaultMutableTreeNode("Radio One by Jimi Hendrix");
        top.add(Folder);


        music = new DefaultMutableTreeNode(new PlayList("Stone free"));
        Folder.add(music);
	

	music = new DefaultMutableTreeNode(new PlayList("Radio One"));
        Folder.add(music);

        music = new DefaultMutableTreeNode(new PlayList("Day Tripper (The Beatles cover)"));
	
        Folder.add(music);

        Folder = new DefaultMutableTreeNode("Siouxsie and the Banshees");
        top.add(Folder);

        DefaultMutableTreeNode album = new DefaultMutableTreeNode(new PlayList("The Scream"));
        Folder.add(album);

	music = new DefaultMutableTreeNode(new PlayList("Pure"));
        album.add(music);
	

	

    }
}